#!/bin/bash

projects=("platform-parent platform-commons platform-remote platform-setting platform-organization platform-customer platform-kase platform-repayment platform-calling platform-external")
force=$1

for project in $projects; do
    if [ ! -d ${project} ]; then
	continue
    fi
    cd ${project}
    if [ ! -d .git ]; then
	cd ..
	continue
    fi
    echo "===============================开始拉取${project}===============================" 
    echo
    msg=`git pull`
    echo ${msg}
    echo
    if [[ ${msg} != *Already* ]] || [ "${force}" == "-f" ]; then
        mvn clean install -Dmaven.test.skip=true
	echo
    fi
    cd ..
done
